Device = 350Port = 36 ;Offset for Drive 0RepPort = 174SigTask = 16Task = 276FindName = -276Track = 20 ;Number of the Track to be read
;Destination = ???? ;Destination must be provided by the user.Destination =$5000 ; for testing only
move.l $4,a6 ;get ExecBase lea Name,a1 ;set Pointer to Name lea Device(a6),a0 ;Pointer to Device-List jsr FindName(a6) ;search for Trackdisk-Device tst.l d0 ;Device found ? beq Error ;No, Error
move.l Task(a6),a0 ;get Pointer to user Task move.l d0,a6 ;Pointer to Task to A6
move.l Port(a6),a3 ;get pointer to drive
;Port (Drive 0)
lea RepPort(a3),a1 ;Pointer to RepPort move.l SigTask(a1),-(a7) ;save Pointer to Task move.l a1,-(a7) ;save Pointer to RepPort move.l a0,SigTask(a1) ;store user Task bset #0,34(a3) ;block Trackdisk-Task ; The actual load routine starts here move.l #Track,d0 ;Track-Number to D0 move.w d0,74(a3) ;store in Structure move.l 78(a3),a2 ;Pointer to Data buffer move.w d0,(a2) ;store Track-Number bclr #0,2(a2) ;erase Bit 0 clr.b 66(a3) ;erase Errornumber jsr $fea99e ;read Track clr.l d0 ;Value for Motor off jsr $fea462 ;switch Motor off move.b 3(a2),d0 ;first Block number to D0 cmp.b #$0b,d0 ;Number larger than 11 bcc Ende ;yes, Error
move.b #$0b,d6 ;Sector Number clr.l d0 ;first Block = Null sub.b 3(a2),d0 bpl l1 addi.b #$0b,d0 ;Address of the Blockl1: mulu #$440,d0 ;calculate Null lea 1664(a2),a4 ;Pointer to beginning of Data adda.l d0,a4 ;Pointer to Block zero lea Destination,a5 ;set Pointer to destination
clr.l d7 ;start at Sector zero
l3: lea 64(a4),a1 ;Pointer to Data block
move.l a5,a0 ;Destination to A0
move.l #$200,d0 ;Number of Data to be decoded
jsr $feacb2 ;decode Data
adda.l #$200,a5 ;increment Destination Pointer sub.b #1,d6 ;decrement number of Blocks beq Ende ;branch, when done add.b #1,d7 ;increment Block number cmp.b 3(a2),d7 ;continue at beginning of Buffer bne l2 ;no, continue normally lea 1664(a2),a4 ;Pointer at beginning of Buffer bra l3 ;unconditional Jumpl2: add.l #$440,a4 ;Pointer to next Block
bra l3 ;unconditional Jump
; End of the load routine. The modified pointers ; must be restored.Ende: bclr #0,34(a3) ;release Task again
move.l (a7)+,a1 ;get Pointer to Task move.l (a7)+,SigTask(a1) ;enter again in PortError: rts ;Return jumpName: dc.b 'trackdisk.device',0 END